<template>
  <div>
    <el-button type="primary" @click="add()">添加</el-button>
    <v-add :obj="obj" ref="oCh"></v-add>
    <v-list @edit="edit" ></v-list>
  </div>
</template>

<script>
import { mapGetters, mapActions } from "vuex";
import vAdd from "./commponents/add.vue";
import vList from "./commponents/list.vue";
export default {
  props: [],
  components: {
    vAdd,
    vList
  },
  data() {
    return {
      obj: {
        isShow: false,
        isAdd: false,
      }
    };
  },
  computed: {
    ...mapGetters({}),
  },
  methods: {
    ...mapActions({}),
     add(){
        this.obj.isShow=true,
        this.obj.isAdd=true
    },
    edit(e){
         this.obj.isShow=true,
        this.obj.isAdd=false
        this.$refs.oCh.getOne(e)
    }
  },
  mounted() {},
};
</script>
<style scoped>
</style>